<template>
  <div >
    <div class="tableRoll">
        <roll height="650px">
            <el-table :data="tableData" border style="width: 100%">
                <el-table-column type="index" label="序号" width="107"></el-table-column>
                <el-table-column prop="code" label="充电桩"></el-table-column>
                <el-table-column prop="date" label="充电时间"></el-table-column>
                <el-table-column label="操作">
                <template slot-scope="scope">
                    <div>
                    <span @click="see(scope.row)">查看</span>
                    </div>
                </template>
                </el-table-column>
            </el-table>
        </roll>
    </div>
    <div class="tablePage">
            <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10,15]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="20">
            </el-pagination>
    </div>
         <order v-show="orderShow" @closeOrder="closeOrder"/>
  </div>
</template>
<script>
import roll from "@/components/Roll"
import order from "./order"
export default {
    components:{
        roll,
        order,
    },
  data() {
    return {
        orderShow:false,
      tableData: [
        {
          date: "2016-05-02",
          code: "1589518635483"
        },
        {
          date: "2016-05-04",
          code: "1589518635483"
        },
        {
          date: "2016-05-01",
          code: "1589518635483"
        },
        {
          date: "2016-05-03",
          code: "1589518635483"
        },  {
          date: "2016-05-02",
          code: "1589518635483"
        }, {
          date: "2016-05-02",
          code: "1589518635483"
        },
        {
          date: "2016-05-03",
          code: "1589518635483"
        },  {
          date: "2016-05-02",
          code: "1589518635483"
        }, {
          date: "2016-05-02",
          code: "1589518635483"
        },
        {
          date: "2016-05-04",
          code: "1589518635483"
        },
        {
          date: "2016-05-01",
          code: "1589518635483"
        }
      ],
        currentPage:1, //当前第几页
        pageSize:10
    };
  },
  methods: {
    see(res) {
     this.$emit('see')
     this.orderShow=true
    },
    handleSizeChange(e){
        this.$emit("SizeChange",e)
    },
    handleCurrentChange(e){
        this.$emit("CurrentChange",e)
    },
    // 关闭查询
    closeOrder(){
            this.orderShow=false
    }
  }
};
</script>
<style  scoped>
.tablePage {
    text-align: center;
}
.tableRoll {
  height:650px ;
}
.tablePage {
    margin-top: 10px;
}
/deep/ .btn-prev {
    background-color: rgba(0,0,0,0.0)
}

span {
  cursor: pointer;
}
/* .position {
    position: absolute;
    top:0px;
} */
</style>